package com.le.tester.book.effectivejava3rdchinese.articlethirty;

import java.util.HashSet;
import java.util.Set;

/**
 * createTime：2022/8/17 17:03
 * description：
 */
public class Demo<E> {
    public static Set union(Set s1, Set s2) {
        Set result = new HashSet(s1);
        result.addAll(s2);
        return result;
    }

    public static <E> Set<E> unionPlus(Set<E> s1, Set<E> s2) {
        Set<E> result = new HashSet<>(s1);

        result.addAll(s2);

        return result;
    }
}
